<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
#div1{ width:200px; height:200px; background:red;}
#div2{ width:100px; height:100px; background:yellow;}
</style>
<script src="jquery-2.0.3.js"></script>
<script>
/*window.onload = function(){
	var oDiv1 = document.getElementById('div1');
	var oDiv2 = document.getElementById('div2');
	var oSpan1 = document.getElementById('span1');
	oDiv1.onmouseover = function(ev){
		var ev = ev || window.event;
		var a = this;
		var b = ev.relatedTarget;
		if( !elContains(a, b) && a!=b ){
			oSpan1.innerHTML += '1';
		}
	};
	oDiv1.onmouseout = function(ev){
		var ev = ev || window.event;
		var a = this;
		var b = ev.relatedTarget;
		if( !elContains(a, b) && a!=b ){
			oSpan1.innerHTML += '2';
		}
	};
};
function elContains(a, b){  //两个元素是否是嵌套关系
	return a.contains ? a != b && a.contains(b) : !!(a.compareDocumentPosition(b) & 16);
}*/
$(function(){
	
	$('#span1').on('click.aaa',function(){
		alert(1);
	});
	$('#span1').on('mouseover.aaa',function(){
		alert(2);
	});
	
	$('#span1').off('.aaa');
	
});
</script>
</head>

<body>
<div id="div1">
	<div id="div2"></div>
</div>
<span id="span1">11111111111</span>
</body>
</html>
